package cn.hnu.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 同意结果返回类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseResult implements Serializable {
    private Integer code;
    private String msg;
    private Object data;

    private static BaseResult ok(String msg) {
        return new BaseResult(200, msg, null);
    }

    public static BaseResult ok(Object data) {
        return new BaseResult(200, "success", data);
    }

    public static BaseResult fail(String msg) {
        return new BaseResult(400, msg, null);
    }

}
